import { post, get } from '@/http/axios'
export default {
  namespaced: true,
  state: {
    // 栏目数据
    categoryData:[]
  },
  mutations: {
    SET_CATEGORY(state, data){
      state.categoryData = data
    }
  },
  actions: {
    // 获取所有的栏目信息
    async getCategoryDataVuex({commit},param){
      // 发送网络请求
      let res = await get('/productCategory/pageQuery', param)
      // console.log(res.data.data.list);
      // 提交
      commit('SET_CATEGORY', res.data.data.list)
    }
  }
}